<script>
    function Calculator() {}

    Calculator.prototype = {
        add: function(a, b) {
            return a + b;
        },
        subtract: function(a, b) {
            return a - b;
        },
        multiply: function(a, b) {
            return a * b;
        },
        divide: function(a, b) {
            if (b === 0) {
                throw new Error("Cannot divide by zero");
            }
            return a / b;
        }
    };

    // 使用示例
    var calculator = new Calculator();
    console.log(calculator.add(5, 3)); // 输出8
    console.log(calculator.subtract(5, 3)); // 输出2
    console.log(calculator.multiply(5, 3)); // 输出15
    console.log(calculator.divide(5, 3)); // 输出1.6666666666666667
</script>